#include <iostream>
using namespace std;
#include<string>
#include<deque>

int main()
{
	deque<int>v;
	deque<int>v1;
	for (int i = 0; i < 5; i++)
	{
		v.push_back(i + 1);
		v1.push_back(i + 2);
	}
	for (deque<int>::const_iterator it = v.begin(); it != v.end(); it++)
	{
		cout << *it << " ";
	}
	cout << endl;
	
	v1.insert(v1.end(), v.begin() + 2, v.end());
	for (deque<int>::const_iterator it = v1.begin(); it != v1.end(); it++)
	{
		cout << *it << " ";
	}
	system("pause");
	return 0;
}